package com.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.project.bean.BiddConfirmBean;
import com.project.mapper.IBiddConfirmMapper;
import com.project.service.IMessageService;
import com.project.vo.MessageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class MessageServiceImpl implements IMessageService {
    @Autowired
    private IBiddConfirmMapper biddConfirmMapper;

    @Override
    public MessageVo findMsg(Long supplierId) {
        MessageVo messageVo=new MessageVo();

        //中标确认
        QueryWrapper<BiddConfirmBean> qw1=new QueryWrapper<>();
        qw1.eq("fk_supplierId", supplierId);
        qw1.eq("bc_read", 0);
        boolean confirm=biddConfirmMapper.exists(qw1);
        messageVo.setBiddConfirm(confirm);

        return messageVo;
    }
}
